<%@page import="accessor.Category"%>
<%@page import="accessor.CategoryAccessor"%>
<%@include file="header.jsp" %>
<div class="break_line"></div>
<div class="break_line"></div>
<div id="content">
    <div id="title_content">UPDATE CATEGORY</div>
    <form method="POST" action="../update_category">
        <%
            int catID = request.getParameter("catID") != null ? Integer.parseInt(request.getParameter("catID")) : 0;
            CategoryAccessor  categoryAccessor = new CategoryAccessor();
            Category category = categoryAccessor.getCategoryByID(catID);
        %>
        <input type="hidden" name="catID" value="<%= category!=null?category.getCategoryID():0 %>"/>
        <table class="form_content" width="100%">
            <tr>
                <td>Cate NAME: </td>
                <td>
                    <input type="text" name="catName" class="form_input" value="<%= category!=null?category.getCategoryName():"" %>"/>
                </td>
            </tr>
            <tr>
                <td></td>
                <td colspan="2"><input type="submit" name="submit" class="form_input" style="width: 100px;" value="Update"/></td>
            </tr>
        </table>
    </form>
</div>
<!--END content-->
<%@include file="footer.jsp" %>